<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="text" name="" id="num">+
    <input type="text" name="" id="num1">
    <button id="btn">=</button>
    <input type="text" name="" id="num2">
    <!---减法-->
    <input type="text" name="" id="num3">-
    <input type="text" name="" id="num4">
    <button id="btn1">=</button>
    <input type="text" name="" id="num5">
    <!--乘法--->
    <input type="text" name="" id="num6">*
    <input type="text" name="" id="num7">
    <button id="btn2">=</button>
    <input type="text" name="" id="num8">
    <!---除法-->
    <input type="text" name="" id="num9">/
    <input type="text" name="" id="num10">
    <button id="btn3">=</button>
    <input type="text" name="" id="num11">
    <script>
        document.getElementById("btn").onclick = function() {
            //确定第一个值为数字
            var _num = parseInt(document.getElementById("num").value);
            //确定第二个值为数字
            var _num1 = parseInt(document.getElementById("num1").value);
            var _num = _num + _num1;
            document.getElementById("num2").value = _num;
        }
        document.getElementById("btn1").onclick = function() {
            var _num2 = parseInt(document.getElementById("num3").value);
            var _num3 = parseInt(document.getElementById("num4").value);
            var _num2 = _num2 - _num3
            document.getElementById("num5").value = _num2;
        }
        document.getElementById("btn2").onclick = function() {
            var _num4 = parseInt(document.getElementById("num6").value);
            var _num5 = parseInt(document.getElementById("num7").value);
            var _num4 = _num4 * _num5;
            document.getElementById("num8").value = _num4;
        }
        document.getElementById("btn3").onclick = function() {
            var _num6 = parseInt(document.getElementById("num9").value);
            var _num7 = parseInt(document.getElementById("num10").value);
            var _num6 = _num6 / _num7;
            document.getElementById("num11").value = _num6;
        }
    </script>
</body>

</html>